  <%if (not @project.use_permission or @project.use_permission.nil?) or (@project.use_permission and (@project.file_categories.select{|c| @cur_user.has_permission?("prj_" + @project.id.to_s + "_#{c.id}_fs_cat_new")}.size > 0 or @cur_user.has_permission?("prj_" + @project.id.to_s + "_unc_fs_cat_new")))%>
    <%=link_to image_tag("upload_a_file.gif".t,:border=>0),new_project_file_path(params[:project_id])%>
  <%end%>
<div id=cat_sidebar> 
<h3>
 <%if (not @project.use_permission) or (@project.use_permission and @cur_user.have_power?(@project))%>
<span id="edit_display" class=float_right><%=link_to "Edit".t,"#",:onclick=>"Element.toggle('rename');Element.toggle('edit_display');Element.toggle('edit_hide');Element.toggle('new_cat')",:class=>'admin'%></span>
 <%end%>
<span id="edit_hide" class=float_right style="display:none"><%=link_to "Done edit".t,"#",:onclick=>"Element.toggle('rename');Element.toggle('edit_display');Element.toggle('edit_hide');Element.toggle('new_cat')",:class=>'admin'%></span>
<%="File Categories".t%>
</h3>
<div class="activity_item">
<div id='rename' style="right:10px;border:0px red solid;height:<%=(@project.file_categories.size + 2) * 30%>px;width:78px;background:#e5e5e5;clear: both;position:absolute"></div>
<%if params[:category_id].nil?%>
<span class=selected_label>
<%else%>
<span class=label>
<%end%>
<%=link_to "All Files".t,project_files_path(params[:project_id])%>(<%=@project.files.size%>)
</span>
</div>

<div class='activity_item'>
<%if params[:category_id].to_s == "uncat"%>
<span class=selected_label>
<%else%>
<span class=label>
<%end%>
<%=link_to "Uncategorized".t,project_file_in_category_path(params[:project_id],"uncat")%>(<%=@project.uncat_file_size%>)
</span>
</div>

<div id=cat_side_show>
<%=render :partial=>'categories/sidebar_list',:locals=>{:project=>Project.find(params[:project_id]),:label=>'files'}%>
</div>
</div>

</span>
</div>

